package com.xxxx.spring.reflect;

import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;

public class testFF {
    public static void main(String[] args) throws ClassNotFoundException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException, NoSuchFieldException {
        Container container = new Container();
        container.init();
        Class<?> clazz = Class.forName("com.xxxx.demo.domain.Customer");
        Object obj = container.getServiceInstanceByClass(clazz);
        System.out.println(obj);
        System.out.println("--------");
        container.createInstance(clazz);
        Field field = clazz.getDeclaredField("name");
        field.setAccessible(true);
        Object fieldValue = field.get(obj);
        System.out.println(fieldValue);
    }
}
